﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Wind;
using System.Reflection;
using System.IO;

namespace God
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            AirData air = (AirData)FindResource("AirData");

            string loc = Assembly.GetExecutingAssembly().Location;
            string db = Path.ChangeExtension(loc, "db3");
            air.OpenOrCreate(db);
        }

        private void Application_Exit(object sender, ExitEventArgs e)
        {
            AirData air = (AirData)FindResource("AirData");
            air.Save();
            air.Close();
        }
    }
}
